//
// Created by Scave on 2025/8/29.
//

#ifndef RIDER3D_DATAUTIL_H
#define RIDER3D_DATAUTIL_H

#include "Define.h"

NS_RIDER_BEGIN

    class DataUtil {
    public:
        template<typename T, typename R>
        static std::vector<R> Convert(const std::vector<T>& origin, FUNCTION<R(const T&)> converter) {
            std::vector<R> result;
            for (const auto& item: origin) {
                R r = converter(item);
                result.push_back(r);
            }
            return result;
        }
    };

NS_RIDER_END

#endif //RIDER3D_DATAUTIL_H
